.class public Ldgb/k0;
.super Ljava/lang/Object;
.source "SourceFile"


# static fields
.field private static volatile b:Ldgb/k0;


# instance fields
.field private final a:Landroid/os/Handler;


# direct methods
.method private constructor <init>()V
    .locals 2

    .line 1
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const-string v0, "priority_thread"

    const/4 v1, 0x7

    .line 2
    invoke-direct {p0, v0, v1}, Ldgb/k0;->a(Ljava/lang/String;I)Landroid/os/Handler;

    const-string v0, "normal_thread"

    const/16 v1, 0x8

    .line 3
    invoke-direct {p0, v0, v1}, Ldgb/k0;->a(Ljava/lang/String;I)Landroid/os/Handler;

    move-result-object v0

    iput-object v0, p0, Ldgb/k0;->a:Landroid/os/Handler;

    return-void
.end method

.method private a(Ljava/lang/String;I)Landroid/os/Handler;
    .locals 1

    .line 7
    new-instance v0, Landroid/os/HandlerThread;

    invoke-direct {v0, p1}, Landroid/os/HandlerThread;-><init>(Ljava/lang/String;)V

    .line 8
    invoke-virtual {v0, p2}, Landroid/os/HandlerThread;->setPriority(I)V

    .line 9
    invoke-virtual {v0}, Landroid/os/HandlerThread;->start()V

    .line 10
    new-instance p1, Landroid/os/Handler;

    invoke-direct {p0, v0}, Ldgb/k0;->a(Landroid/os/HandlerThread;)Landroid/os/Looper;

    move-result-object p2

    invoke-direct {p1, p2}, Landroid/os/Handler;-><init>(Landroid/os/Looper;)V

    return-object p1
.end method

.method private a(Landroid/os/HandlerThread;)Landroid/os/Looper;
    .locals 0

    .line 13
    invoke-virtual {p1}, Landroid/os/HandlerThread;->getLooper()Landroid/os/Looper;

    move-result-object p1

    return-object p1
.end method

.method public static a()Ldgb/k0;
    .locals 2

    .line 1
    sget-object v0, Ldgb/k0;->b:Ldgb/k0;

    if-nez v0, :cond_1

    .line 2
    const-class v0, Ldgb/k0;

    monitor-enter v0

    .line 3
    :try_start_0
    sget-object v1, Ldgb/k0;->b:Ldgb/k0;

    if-nez v1, :cond_0

    .line 4
    new-instance v1, Ldgb/k0;

    invoke-direct {v1}, Ldgb/k0;-><init>()V

    sput-object v1, Ldgb/k0;->b:Ldgb/k0;

    .line 5
    :cond_0
    monitor-exit v0

    goto :goto_0

    :catchall_0
    move-exception v1

    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v1

    .line 6
    :cond_1
    :goto_0
    sget-object v0, Ldgb/k0;->b:Ldgb/k0;

    return-object v0
.end method

.method private declared-synchronized a(Ldgb/bp;)V
    .locals 1

    monitor-enter p0

    .line 11
    :try_start_0
    iget-object v0, p0, Ldgb/k0;->a:Landroid/os/Handler;

    invoke-virtual {v0, p1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 12
    monitor-exit p0

    return-void

    :catchall_0
    move-exception p1

    monitor-exit p0

    throw p1
.end method


# virtual methods
.method public a(Landroid/content/Context;ILjava/lang/String;[BLjava/util/Map;Ljava/lang/String;)I
    .locals 2
    .param p1    # Landroid/content/Context;
        .annotation build Landroidx/annotation/NonNull;
        .end annotation
    .end param
    .param p3    # Ljava/lang/String;
        .annotation build Landroidx/annotation/NonNull;
        .end annotation
    .end param
    .param p4    # [B
        .annotation build Landroidx/annotation/NonNull;
        .end annotation
    .end param
    .param p5    # Ljava/util/Map;
        .annotation build Landroidx/annotation/Nullable;
        .end annotation
    .end param
    .param p6    # Ljava/lang/String;
        .annotation build Landroidx/annotation/NonNull;
        .end annotation
    .end param
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/content/Context;",
            "I",
            "Ljava/lang/String;",
            "[B",
            "Ljava/util/Map<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;",
            "Ljava/lang/String;",
            ")I"
        }
    .end annotation

    .line 24
    new-instance v0, Ldgb/i0;

    invoke-direct {v0, p3}, Ldgb/i0;-><init>(Ljava/lang/String;)V

    .line 25
    iput-object p5, v0, Ldgb/i0;->k:Ljava/util/Map;

    .line 26
    iput p2, v0, Ldgb/i0;->b:I

    .line 27
    iput-object p6, v0, Ldgb/i0;->h:Ljava/lang/String;

    const/4 p2, 0x0

    .line 28
    iput-boolean p2, v0, Ldgb/i0;->l:Z

    .line 29
    new-instance p3, Ljava/util/concurrent/CountDownLatch;

    const/4 p5, 0x1

    invoke-direct {p3, p5}, Ljava/util/concurrent/CountDownLatch;-><init>(I)V

    new-array p5, p5, [I

    .line 30
    new-instance p6, Ldgb/l0;

    new-instance v1, Ldgb/k0$a;

    invoke-direct {v1, p0, p5, p3}, Ldgb/k0$a;-><init>(Ldgb/k0;[ILjava/util/concurrent/CountDownLatch;)V

    invoke-direct {p6, p1, p4, v0, v1}, Ldgb/l0;-><init>(Landroid/content/Context;[BLdgb/i0;Ldgb/g0;)V

    .line 31
    invoke-direct {p0, p6}, Ldgb/k0;->a(Ldgb/bp;)V

    const-wide/16 v0, 0x3c

    .line 32
    :try_start_0
    sget-object p1, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit;

    invoke-virtual {p3, v0, v1, p1}, Ljava/util/concurrent/CountDownLatch;->await(JLjava/util/concurrent/TimeUnit;)Z
    :try_end_0
    .catch Ljava/lang/InterruptedException; {:try_start_0 .. :try_end_0} :catch_0

    .line 33
    aget p1, p5, p2

    return p1

    :catch_0
    const/16 p1, 0xc3

    return p1
.end method

.method public a(Landroid/content/Context;ILjava/lang/String;Ldgb/g0;)V
    .locals 1
    .param p1    # Landroid/content/Context;
        .annotation build Landroidx/annotation/NonNull;
        .end annotation
    .end param
    .param p3    # Ljava/lang/String;
        .annotation build Landroidx/annotation/NonNull;
        .end annotation
    .end param
    .param p4    # Ldgb/g0;
        .annotation build Landroidx/annotation/NonNull;
        .end annotation
    .end param

    .line 20
    new-instance v0, Ldgb/i0;

    invoke-direct {v0, p3}, Ldgb/i0;-><init>(Ljava/lang/String;)V

    .line 21
    iput p2, v0, Ldgb/i0;->b:I

    .line 22
    new-instance p2, Ldgb/f0;

    invoke-direct {p2, p1, v0, p4}, Ldgb/f0;-><init>(Landroid/content/Context;Ldgb/i0;Ldgb/g0;)V

    .line 23
    invoke-direct {p0, p2}, Ldgb/k0;->a(Ldgb/bp;)V

    return-void
.end method

.method public a(Landroid/content/Context;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;JLdgb/g0;)V
    .locals 1
    .param p1    # Landroid/content/Context;
        .annotation build Landroidx/annotation/NonNull;
        .end annotation
    .end param
    .param p3    # Ljava/lang/String;
        .annotation build Landroidx/annotation/NonNull;
        .end annotation
    .end param
    .param p4    # Ljava/lang/String;
        .annotation build Landroidx/annotation/NonNull;
        .end annotation
    .end param
    .param p5    # Ljava/lang/String;
        .annotation build Landroidx/annotation/NonNull;
        .end annotation
    .end param
    .param p8    # Ldgb/g0;
        .annotation build Landroidx/annotation/NonNull;
        .end annotation
    .end param

    .line 14
    new-instance v0, Ldgb/i0;

    invoke-direct {v0, p3, p5}, Ldgb/i0;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 15
    iput-wide p6, v0, Ldgb/i0;->c:J

    .line 16
    iput p2, v0, Ldgb/i0;->b:I

    .line 17
    iput-object p4, v0, Ldgb/i0;->h:Ljava/lang/String;

    .line 18
    new-instance p2, Ldgb/f0;

    invoke-direct {p2, p1, v0, p8}, Ldgb/f0;-><init>(Landroid/content/Context;Ldgb/i0;Ldgb/g0;)V

    .line 19
    invoke-direct {p0, p2}, Ldgb/k0;->a(Ldgb/bp;)V

    return-void
.end method
